<script>
 $.ajax({
            url:"home/select_stu",
            type:"GET",
            {#发送json数据到服务器#}
            dataType :"json",
            {#请求成功回调函数#}
            success:function (data) {

                var html = '';
				for ( var i = 0; i < data.length; i++) {//循环json对象，拼接tr,td的htm
				    var value=data[i].id
                    var k = '/home/delete?id='+value;
                    var rque = '"javascript:return myFunction()"';
				    var j = '/home/modify?id='+value;
                    var del = "<a href="+k+" onclick="+rque+"><button>删除</button></a>"
                    var alter = "<a href="+j+"><button>更新</button></a>"
					s = "<tr><td>" + data[i].id + "</td><td>" + data[i].name + "</td><td>" +
            data[i].age +"</td><td>" + data[i].sex + "</td><td>" + data[i].grade
                        + "</td><td>"+del+alter+"</td></tr>"
					$('#tr').append(s);
				}
            },
            {#请求失败回调函数#}
            error:function () {
                alert("查询失败")
            }
        });
</script>